# Where to find header files of xep modules
set(YOOHOO_XEP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/extensions/xep/include)
include_directories(${YOOHOO_XEP_INCLUDE_DIR})

foreach(module ${YOOHOO_XEP_MODULES})
	set(YOOHOO_LINK_DIRECTORY ${PROJECT_BINARY_DIR}/tmp/xep/${module})
	
	if(WIN32 AND (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
		set(YOOHOO_LINK_DIRECTORY ${YOOHOO_LINK_DIRECTORY}/Debug)
	else(WIN32 AND (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
		set(YOOHOO_LINK_DIRECTORY ${YOOHOO_LINK_DIRECTORY}/Release)
	endif(WIN32 AND (${CMAKE_BUILD_TYPE} MATCHES "Debug"))

	link_directories(${YOOHOO_LINK_DIRECTORY})
endforeach(module ${YOOHOO_XEP_MODULES})

foreach(module ${YOOHOO_XEP_MODULES})
	set(YOOHOO_XEP_MODULE_NAME ${module})

	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/tmp/xep/${YOOHOO_XEP_MODULE_NAME})

	set(YOOHOO_EXT_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
	
	if(WIN32 AND (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
		set(YOOHOO_EXT_OUTPUT_DIR ${YOOHOO_EXT_OUTPUT_DIR}/Debug)
	else(WIN32 AND (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
		set(YOOHOO_EXT_OUTPUT_DIR ${YOOHOO_EXT_OUTPUT_DIR}/Release)
	endif(WIN32 AND (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
	
	add_subdirectory(${module})
endforeach(module ${YOOHOO_XEP_MODULES})
